﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace Affinity.Synthesis
{
    public static class Extensions

    {        
        /// <summary>
        /// Binds a parameterless lambda expression to a property.
        /// </summary>
        /// <typeparam name="TReturn"></typeparam>
        /// <param name="propertyName"></param>
        /// <param name="lambdaExpression"></param>
        /// <param name="defaultValue"></param>
        /// <returns></returns>
        public static TReturn BindLambda<TReturn>(this object target, string propertyName, Expression<Func<TReturn>> lambdaExpression, TReturn defaultValue = default(TReturn))
        {
            return LambdaBindingTargetManager.BindLambda<TReturn>(target, propertyName, lambdaExpression, defaultValue);
        }
    }
}
